{% extends 'generic/object_detail.html' %}
{% load helpers %}

{% block content_left_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Role</strong>
            </div>
            <table class="table table-hover panel-body attr-table">
                <tr>
                    <td>Description</td>
                    <td>{{ object.description|placeholder }}</td>
                </tr>
                <tr>
                    <td>Weight</td>
                    <td>{{ object.weight }}</td>
                </tr>
                <tr>
                    <td>Prefixes</td>
                    <td>
                        <a href="{% url 'ipam:prefix_list' %}?role={{ object.slug }}">{{ prefix_table.rows|length }}</a>
                    </td>
                </tr>
                <tr>
                    <td>VLANs</td>
                    <td>
                        <a href="{% url 'ipam:vlan_list' %}?role={{ object.slug }}">{{ vlan_table.rows|length }}</a>
                    </td>
                </tr>
            </table>
        </div>
{% endblock content_left_page %}

{% block content_full_width_page %}
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>Prefixes</strong>
            </div>
            {% include 'inc/table.html' with table=prefix_table %}
            {% if perms.ipam.add_prefix %}
                <div class="panel-footer text-right noprint">
                    <a href="{% url 'ipam:prefix_add' %}?role={{ object.pk }}" class="btn btn-xs btn-primary">
                        <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add prefix
                    </a>
                </div>
            {% endif %}
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                <strong>VLANs</strong>
            </div>
            {% include 'inc/table.html' with table=vlan_table %}
            {% if perms.ipam.add_vlan %}
                <div class="panel-footer text-right noprint">
                    <a href="{% url 'ipam:vlan_add' %}?role={{ object.pk }}" class="btn btn-xs btn-primary">
                        <span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add vlan
                    </a>
                </div>
            {% endif %}
        </div>
        {% include 'inc/paginator.html' with paginator=vlan_table.paginator page=vlan_table.page %}
        <div class="row"></div>
{% endblock content_full_width_page %}
